package com.example.weexnews;

import android.app.Application;

import com.taobao.weex.InitConfig;
import com.taobao.weex.WXSDKEngine;
import com.taobao.weex.common.WXException;

public class WeexApp extends Application {

    private static WeexApp sWeexApp;

    @Override
    public void onCreate() {
        super.onCreate();
        try {
            sWeexApp = WeexApp.this;
            WXSDKEngine.registerModule("netmodule", NetModule.class);
            WXSDKEngine.registerModule("jump", JumpModule.class);
            InitConfig config = new InitConfig.Builder().setImgAdapter(new ImageAdapter()).build();
            WXSDKEngine.initialize(this, config);
        } catch (WXException e) {
            e.printStackTrace();
        }
    }

    public static WeexApp getWeexApp() {
        return sWeexApp;
    }

}
